<template>
  <el-dialog
    :visible="showDialog"
    append-to-body
    title="分配校色"
    @close="close"
  >
    <el-checkbox-group v-model="checkList">
      <el-checkbox v-for="item in list" :key="item.id" :label="item.id">
        {{ item.name }} </el-checkbox>
    </el-checkbox-group>
  </el-dialog>
</template>

<script>
import { getRoles, getRolesEnabled } from '@/api/role'
export default {
  props: {
    showDialog: {
      required: true,
      type: Boolean
    }
  },

  data() {
    return {
      checkList: [],
      list: []
    }
  },
  created() {
    this.add()
  },
  methods: {
    close() {
      this.$emit('update:showDialog', false)
    },
    async add() {
      const res = await getRolesEnabled()
      console.log(res)
      // this.list = res.data
    }

  }
}

</script>
